//
//  NoCommitTableViewCell.m
//  Findif
//
//  Created by Mac on 2019/2/12.
//  Copyright © 2019年 Cicel Chen. All rights reserved.
//

#import "NoCommitTableViewCell.h"

@interface NoCommitTableViewCell ()

// 背景
@property (nonatomic, weak) UIView * backView;
// 名称
@property (nonatomic, weak) UILabel * showLabel;

@end

@implementation NoCommitTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    
    return self;
}

- (void)setupUI{
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.backgroundColor = ColorWithRGB(0xF4F5F6);
    
    UIView * backView = [UIView new];
    
    backView.backgroundColor = ZRWhiteColor;
    backView.userInteractionEnabled = YES;
    backView.layer.cornerRadius = 5 * SCREENH6;
    backView.layer.masksToBounds = YES;
    
    self.backView = backView;
    
    [self.contentView addSubview:self.backView];
    
    UILabel * showLabel = [UILabel new];
    
    showLabel.textColor = [UIColor lightGrayColor];
    showLabel.text = @"暂无评论~";
    showLabel.font = [UIFont systemFontOfSize:15 * SCREENH6];
    showLabel.textAlignment = NSTextAlignmentCenter;
    
    self.showLabel = showLabel;
    
    [self.backView addSubview:self.showLabel];
}

- (void)layoutSubviews{
    
    [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.contentView).offset(15 * SCREENH6);
        make.trailing.mas_equalTo(self.contentView).offset(-15 * SCREENH6);
        make.top.bottom.mas_equalTo(self.contentView);
    }];
    
    [self.showLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.backView);
        make.centerX.mas_equalTo(self.backView);
    }];
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
